package com.jfinal.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

import com.jfinal.core.JFinalFilter;

@SpringBootApplication
public class ExampleApplication {
	
	@Bean
	public FilterRegistrationBean jfFilterReg(){
		FilterRegistrationBean reg = new FilterRegistrationBean();
		reg.setFilter(new JFinalFilter());
		reg.addInitParameter("configClass", "com.jfinal.example.AppJFConfig");
		reg.addUrlPatterns("/*");
		return reg;
	}

	public static void main(String[] args) {
		SpringApplication.run(ExampleApplication.class, args);
	}
}
